home *** CD-ROM | disk | FTP | other *** search
-
- A Short Introduction to Genetic Algorithms
-
- Genetic algorithms are a class of fairly recent and remarkably
- powerful and flexible set of optimization/search strategies.
-
- Genetic algorithms can be used for a multitude of problems such
- as function optimization, searching for solutions, best-fit problems,
- evolving rule-based control systems and much, much more.
-
- The basic idea of genetic algorithms is the population. A set
- of candidate solutions or partial solutions which can
- be evaluated and compared to the other candidates in the set.
-
- Historically, the most common type of representation for
- genetic algorithms has been the bitstring. So, if for no other
- reason than this, this mini introduction will only consider bitstrings.
-
-
- A general genetic algorith can be described quite simply like this:
-
-
- Let P be a set of candidate solutions to a problem such that each
- candidate solution can be directly or indirectly evaluated and
- assigned a fitness according to how good it is.
-
- Pick candidates from P in such a manner that candidates with higher
- fitness have a higher probability of being selected. Generate a new
- individual from those picked by using crossover and mutation (explained
- below) and repeat until |P| new candidates have been generated.
- (|P| = the number of elements in P)
-
- Form the set P' containing those individuals generated above.
-
- Repeat until some criteria for stopping has been fulfilled.
-
-
-
- Crossover and mutation for bitstrings.
-
-
- Consider the two bitstrings 1110100011 and 0101011101, the common crossover
- operation for bistrings is simply a split-and-recombine operation. Let
- this example illustrate:
-
- Example:
-
- Perform crossover of the above bitstrings a position 3 counted from the right
- and beginning at zero.
-
- ---> Crossover point.
- |
- 1110100011 Old bitstrings
- 0101011101
- ----------x
- 1110101101 New bitstrings
- 0101010011
- ||||
- --------> These bits have now been swapped between the bitstrings.
-
- Multipoint crossover is the same thing but with several crossover points,
- this can be simulated by repeated singlepoint crossover.
-
-
- Mutation is simple the random flipping of one or more bits.
-
- Example:
-
- 1010000010
- ----------m
- 1110000010
- |
- ---- Mutated bit.
-
-
- The main idea is that 'good' sequences will stay in each
-